Page({
  onLoad(options) {
    this.setData({
      theme: wx.getSystemInfoSync().theme || 'light'
    })

    this.setData({
      apiType: options.zh,
      title: options.title,
      zh: options.zh,
      remark: options.remark,
      webUrl: options.docUrl
    })
  },
  data: {
    theme: 'light',
    schema: [{
      prop: 'src',
      label: '图片地址',
      type: 'text'
    }, {
      prop:'mode',
      label:'图片裁剪、缩放的模式',
      type:'picker',
      labelOptions:['scaleToFill','aspectFit','aspectFill','widthFix','heightFix','top','bottom','center','left','right','top left','top right','bottom left','bottom right'],
      valueOptions:['scaleToFill','aspectFit','aspectFill','widthFix','heightFix','top','bottom','center','left','right','top left','top right','bottom left','bottom right']
    },{
      prop:'showMenuByLongpress',
      label:'长按菜单',
      type:'switch'
    }],
    title:'image',
    formData:{
      // src:'../../../resources/pic/cat.jpg',
      src: 'https:\/\/bs.kjcdn.com\/i\/pubwmrsn\/af\/ku\/o6abz.webp',
      mode:'widthFix',
      showMenuByLongpress:true
    },
    result:'',
    showImage:true
  },
  getFormData(e){
    this.setData({
      formData:e.detail.formData,
      showImage:false
    })
    wx.nextTick(()=>{
      this.setData({
        showImage:true
      })
    })
  }
})